<?php

class APPCore_Form_Decorator_File extends Zend_Form_Decorator_Abstract
{
    /**
     * Render html of element after decorator
     *
     * @param string $content
     * @return string
     */
    public function render($content)
    {
        $element = $this->getElement();

        /**
         * Get name of element
         */
        $nameElement = $element->getName();

        /**
         * Set decorator for element
         */
        $element->setDecorators(array(
            'File',
            'Description',
            'Errors',
            array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => $nameElement.'-element')),
            array('Label', array('tag' => 'td')),
            array('Description', array('tag' => 'span', 'escape' => false, 'class' => 'hint')),
            array(array('row' => 'HtmlTag'), array('tag' => 'tr')))
        );
        return $element->__toString();
    }

}